<%
layout("/layouts/platform.html"){
%>
<header class="header navbar bg-white shadow">
    <div class="btn-group tool-button">
        <a class="btn btn-primary navbar-btn" href="${base}/platform/losys/taobao" data-pjax id="goback"><i class="ti-angle-left"></i> 返回</a>
    </div>
</header>

<div class="content-wrap">
    <div class="wrapper" style="min-height:500px;">
        <section class="panel panel-form">
            <form id="unitAddForm" role="form" class="form-horizontal parsley-form" data-parsley-validate
                  action="${base}/platform/losys/taobao/editDo" method="post">
                <div class="row mb10">
                    <div class="col-lg-12">
                         <div class="form-group has-feedback">
                                <input type="hidden" name="id" value="${obj.id!}">
                                <input type="hidden" name="loginname" value="${obj.loginname!}">
                                <input type="hidden" name="status" value="${obj.status!}">
                        </div>
                        <div class="form-group">
                            <label for="phone" class="col-sm-2 control-label">联系方式</label>

                            <div class="col-sm-8">
                                <input type="tel" id="phone" class="form-control" name="phone" data-parsley-required="true"
                                       placeholder="联系方式" data-parsley-pattern="(^[0-9]{3,4}\-[0-9]{3,8}$)|(^[0-9]{3,8}$)|(^\([0-9]{3,4}\)[0-9]{3,8}$)|(^0{0,1}1[3-8][0-9]{9}$)" 
                                       value="${obj.phone!}" maxlength="14">
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="shopname" class="col-sm-2 control-label">店铺/⼯⼚名称</label>

                            <div class="col-sm-8">
                                <input type="text" id="shopname" name="shopname" value="${obj.shopname!}"
                                       class="form-control" placeholder="店铺/⼯⼚名称" maxlength="30">

                            </div>
                        </div>
                        <div class="form-group">
                            <label for="apply_time" class="col-sm-2 control-label">结算方式</label>

                            <div class="col-sm-8">
                                <select id="mosa" name="mosa" class="form-control">
                                     <option value="0" <%if(obj.mosa==0){%>selected<%}%>>现结</option>
                                    <option value="1" <%if(obj.mosa==1){%>selected<%}%>>月结</option>
                                    <option value="2" <%if(obj.mosa==2){%>selected<%}%>>周结</option>
                                </select>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="col-lg-3"></div>
                <div class="col-lg-6">
                    <div class="form-group text-center">
                        <label></label>

                        <div>
                            <button class="btn btn-primary btn-block btn-lg btn-parsley" data-loading-text="正在提交...">提 交</button>
                        </div>
                    </div>
                </div>
            </form>
        </section>

    </div>
</div>
<a class="exit-offscreen"></a>
<script language="JavaScript">

    $(document).ready(function () {
        $('#unitAddForm').ajaxForm({
            dataType: 'json',
            beforeSubmit: function (arr, form, options) {
                form.find("button:submit").button("loading");
            },
            success: function (data, statusText, xhr, form) {
                if (data.code == 0) {
                    Toast.success(data.msg);
                    setTimeout(function () {
                        $("#goback").trigger("click");
                    }, 1000);
                } else {
                    Toast.error(data.msg);
                }
                form.find("button:submit").button("reset");
            }
        });
    });
</script>
<%}%>